package gamePack;

import gamePack.entities.EntityA;
import gamePack.entities.EntityB;

import java.util.LinkedList;

public class Physics {

	public static boolean Collision(EntityA entityA, LinkedList<EntityB> entB) {

		for (int i = 0; i < entB.size(); i++) {
			if (entityA.getBounds().intersects(entB.get(i).getBounds())) {
				return true;
			}
		}
		return false;
	}

	public static boolean Collision(EntityB entityB, LinkedList<EntityA> entA) {

		for (int i = 0; i < entA.size(); i++) {
			if (entityB.getBounds().intersects(entA.get(i).getBounds())) {
				return true;
			}
		}
		return false;
	}

	public static boolean safeCollision(EntityA entityA, EntityA entityPlayer) {
		if (entityA.getBounds().intersects(entityPlayer.getBounds()))
			return true;
		return false;
	}
	
	public static boolean unsafeCollision(EntityB entityB, EntityA entityPlayer){
		if (entityB.getBounds().intersects(entityPlayer.getBounds()))
			return true;
		return false;
	}
}
